package com.dc.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 设备信息
 *
 * @author feishaobin
 * @email
 * @date 2021-12-28 14:51:58
 */
@Data
@ApiModel
@TableName("dc_device")
public class Device implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "")
    private Long id;

    @Excel(name = "子系统")
    @ApiModelProperty(value = "子系统")
    private String subSystem;

    @Excel(name = "设备编码")
    @ApiModelProperty(value = "设备序列号")
    private String serialNumber;

    @Excel(name = "设备名称")
    @ApiModelProperty(value = "设备名称")
    private String name;

    @Excel(name = "设备型号")
    @ApiModelProperty(value = "设备型号")
    private String model;

    @Excel(name = "设备位置")
    @ApiModelProperty(value = "设备位置")
    private String deviceAddress;

    @ApiModelProperty(value = "区域id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long regionId;

    @Excel(name = "区域位置")
    @ApiModelProperty(value = "区域位置")
    private String regionName;

    @Excel(name = "设备厂商")
    @ApiModelProperty(value = "设备厂商")
    private String deviceFactory;

    @Excel(name = "设备状态", replace = {"正常_0", "故障_1", "监管_2", "工作_3", "报警_4", "漏电_5", "启动_6"})
    @ApiModelProperty(value = "设备状态 0：正常 1：故障 2：监管 3：工作 4:报警 5:漏电 6:启动")
    private Integer deviceStatus;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "数量")
    private Integer num;

    @Excel(name = "报警时间")
    @ApiModelProperty(value = "报警时间")
    @TableField(updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
    private Date alarmTime;

    @Excel(name = "信号类型", replace = {"模拟_0,数字_1"})
    @ApiModelProperty(value = "信号类型 0:模拟,1:数字")
    private Integer signalType;

    @Excel(name = "设备类型")
    @ApiModelProperty(value = "设备类型")
    private String deviceType;

    @TableField(exist = false)
    @ApiModelProperty(value = "时间备注字段 HH")
    private String timeRemark;

    @ApiModelProperty(value = "所属楼层")
    private String floorCode;

    @ApiModelProperty(value = "所属楼宇")
    private String buildingCode;
}
